Due to the nature of this code, I would rather that it was not altered.
If you feel that there are alterations that should be made, please contact me.
This code is freely distibutable in its ORIGINAL form.
There are no backdoors in this code.
*/
l="rexxsupport.library";if ~show("L",l) then;if ~addlib(l,0,-30) then do;say "can't find" l;exit;end;l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then do;say "can't find" l;exit;end;l="rxsocket.library";if ~show("L",l) then;if ~addlib(l,0,-30) then do;say "can't find" l;exit;end;if ~Open("STDERR","*","W") then exit;parse arg ar;if open(envar,"env:nbkick","R") then do;alreadyrun = readln(envar);call close(envar);end;if upper(ar) = "QUIT" then do;if alreadyrun ~= "1" then do;say "Netbus Kicker is not running, unable to send quit";exit;end;if open(envar,"env:nbkick","W") then do;writech(envar,"2");call close(envar);exit;end;end;if alreadyrun = 1 then do;say "Netbus Kicker is aleady running, to quit it run the script with the argument QUIT";exit;end;if open(envar,"env:nbkick","W") then do;writech(envar,"1");call close(envar);end;options results;;nbsock = socket("INET","STREAM","IP");if nbsock<0 then say "can't create socket:" errno();nb2sock = socket("INET","STREAM","IP");If nbsock<0 then say "can't create socket:" errno();nksock = socket("INET","STREAM","IP");if nksock<0 then say "can't create socket:" errno();netbus.ADDRFAMILY = "INET";netbus.ADDRADDR = 0;netbus.ADDRPORT = 12345;netbus2.ADDRFAMILY = "INET";netbus2.ADDRADDR = 0;netbus2.ADDRPORT = 12346;nuke.ADDFAMILY = "INET";nuke.ADDRADDR = 0;nuke.ADDRPORT = 139;if bind(nbsock,"NETBUS") < 0 then do;say "can't bind port 12345:" errno();exit;end;if bind(nb2sock,"NETBUS2") < 0 then do;say "can't bind port 12346:" errno();exit;end;if bind(nksock,"NUKE") < 0 then do;say "can't bind port 139:" errno();exit;end;sigl = 0;SEL.READ.0=nbsock;SEL.READ.1=nb2sock;SEL.READ.2=nksock;open = 1;address AMIRC.1;"echo Netbus Kicker active :)";do while open;if Listen(nbsock,5)<0 then do;say "Listen error:" errno();exit;end;if Listen(nb2sock,5)<0 then do;say "Listen error:" errno();exit;end;if Listen(nksock,5)<0 then do;say "Listen error:" errno();exit;end;sel.0.read = 0;sel.1.read = 0;sel.2.read = 0;waits = waitselect("SEL",2,0,sigl);sokfd = -1;if open(envar,"env:nbkick","R") then do;toquit = readln(envar);call close(envar);if toquit = 2 then do;say "QUIT recieved";"echo Netbus Kicker quitting...";exit;end;end;if sel.0.read then do;sokfd = accept(nbsock,rem);type$="Netbus";call FindNick;end;if sel.1.read then do;sokfd = accept(nb2sock,rem);type$="Netbus";from = rem.addrAddr;call FindNick;end;if sel.2.read then do;sokfd = accept(nksock,rem);type$="Nuke";from = rem.addrAddr;call FindNick;end;if sokfd ~= -1 then do;res=closesocket(sokfd);end;end;exit;FindNick:;if IsDotAddr(from) then res = GetHostByAddr("HE",from);else res = GetHostByname("HE",from);if ~res then do;"echo Host <" from "> not found (" || HostErrorstring(HostErrorNo()) || ").";end;hostn = he.hostname;"echo **"type$" Connection** IP: "from", Host: "hostn". Attempting to take action...";getmynick;mynick=result;channels;chans = result;nochans=words(chans);mynum=0;nicknum=0;x=1;do while x <= nochans;cuchan=word(chans,x);"getusers channel="cuchan;currusers = result;numusers=words(currusers);i = 1;do while i <= numusers;nickstr = word(currusers,i);nick =strip(nickstr,B,"@+");userhost nick;test$ = result;test$=translate(test$," ","@"," ");uhost=word(test$,2);done = 0;if uhost = hostn then do;"echo Kicking "nick" from "cuchan;call Kick;done = 1;end;if uhost = from then do;if done ~= 1 then do;"echo Kicking "nick" from "cuchan;call Kick;done = 0;end;end;i=i+1;end;x=x+1;end;RETURN;Kick:;if type$ = "Netbus" then do;rnno=random(1,3,time(s));select;when rnno=1 then do;"say /msg "cuchan" "nick", netbus is illegal.";If action="ban" then do;"say /ban "cuchan" "nick;end;"say /kick "cuchan" "nick" Get Lost, loser";end;when rnno=2 then do;"say /msg "cuchan" "nick", u must take us for morons";If action="ban" then do;"say /ban "cuchan" "nick;end;"say /kick "cuchan" "nick" Netbus is illegal";end;when rnno=3 then do;"say /msg "cuchan" "nick", what sort of moron uses netbus?";If action="ban" then do;"say /ban "cuchan" "nick;end;"say /kick "cuchan" "nick" netbussing will get you into alot of trouble";end;end;end;if type$ = "Nuke" then do;rnno=random(1,3,time(s));select;when rnno=1 then do;"say /msg "cuchan" "nick", nuke? Come on, u can do better than that! :P";if action="ban" then do;"say /ban "nick;end;"say /kick "cuchan" "nick" If u don't try and nuke, I wont have to do this";end;when rnno=2 then do;"say /msg "cuchan" Lamer alert "nick" has attempted to nuke me - big mistake";if action="ban" then do;"say /ban "nick;end;"say /kick "cuchan" "nick" Only lamers and morons nuke, which are you?";end;when rnno="3" then do;"say /msg "cuchan" Nuke is lame, "nick".";if action="ban" then do;"say /ban "nick;end;"say /kick "cuchan" "nick" Don't use it!";end;end;end;RETURN;